feat(tools): add document_cleanup tool#89
Open
gclpixel wants to merge 2 commits into
Open
Conversation
added 2 commits
May 18, 2026 15:54
Added RunCodeCleanupAsync to service interfaces, client, and server to enable code cleanup on open documents via DTE command. Introduced the document_cleanup server tool in DocumentTools for external access, with documentation and attributes for discoverability.
gclpixel
commented
May 18, 2026
| return success ? $"Saved: {path}" : $"Document not found or failed to save: {path}"; | ||
| } | ||
|
|
||
| [McpServerTool(Name = "document_cleanup", Destructive = true, Idempotent = true)] |
Author
There was a problem hiding this comment.
I don't know if this is really correct.
The code cleanup is destructive because it changes the file, and in normal use case, execute the clean up twice change nothing.
gclpixel
commented
May 18, 2026
| } | ||
|
|
||
| [McpServerTool(Name = "document_cleanup", Destructive = true, Idempotent = true)] | ||
| [Description("Run code cleanup on an open document in Visual Studio. The document must already be open in VS. Activates the document and executes the 'Edit.RunCodeCleanupOnFile' command.")] |
Author
There was a problem hiding this comment.
It should be 'EditorContextMenus.FileHealthIndicator.RunDefaultCodeCleanup'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add missing document cleanup tool for running the code clean up in an active document.
Tools to Implement
document_cleanupNotes
Type of Change
feat- New featurefix- Bug fixdocs- Documentation onlyrefactor- Code change that neither fixes a bug nor adds a featuretest- Adding or updating testschore- Maintenance tasksci- CI/CD changesRelated Issues
Checklist